package com.作业.Day2;

import java.util.Scanner;

public class Homework1 {
    public static void main(String[] args) {
      while(true){
          System.out.println("请输入消费金额:");
          Scanner scanner = new Scanner(System.in);
          int i = scanner.nextInt();
          System.out.println("是否参加优惠换购活动");
          if(i>=50&&i<100)
              System.out.println("1.满50元，加2元换购百事可乐饮料1瓶");
          else  if(i>=100&&i<200)
          {System.out.println("2.满100元，加3元换购500ml可乐一瓶");
              System.out.println("3.满100元，加10元换购5公斤面粉");}
          else if(i>200){
              System.out.println("4.满200元，加10元可换购1个苏泊尔炒菜锅");
              System.out.println("5.满200元，加20元可换购欧莱雅爽水一瓶");}
          System.out.println("0,不换购·");
          System.out.println("请选择:");
          int m = scanner.nextInt();
          String name="";
          switch (m){
              case 1:
                  i+=2;
                  name="百事可乐";
                  break;
              case 2:
                  i+=3;
                  name="可乐";
                  break;
              case 3:
                  i+=10;
                  name="面粉";
                  break;
              case 4:
                  i+=10;
                  name="苏泊尔炒菜锅";
                  break;
              case 5:
                  i+=20;
                  name="欧莱雅爽水";
                  break;
          }
          System.out.println("本次消费总金额"+i);
          System.out.println("成功换购:"+name);
      }
      }
}
